package other_chap6;

import java.util.ArrayList;
import java.util.List;

public class Chapter80 {
	
	public static void main(String[] args) {
		final List<String> tickets = new ArrayList<String>();
		for (int i = 0; i < 10000; i++) {
			tickets.add("tickets" + i);
		}
		
		for (int i = 0; i < 10; i++) {
			new Thread(){
				@Override
				public void run() {
					while(true){
						System.out.println(Thread.currentThread().getId() + "-" + tickets.remove(0));
					}
				}
			}.start();
		}
		
	}

}
